This is the listing of the card deck of the first program I wrote ever, that successfully run in my first attempt on May/07/1975 in the IBM-1130 computer at CECAFI.
// JOB T FAC.ING. 0724 *CECAFI*08937*
// FOR
*IOCS(CARD,1132 PRINTER)
*ONE WORD INTEGERS
* EXTENDED PRECISION
*LIST SOURCE PROGRAM
** LILIA 0480 7593905 PEREZ AYALA ANTONIO 75/05/7
SUB = 1.0/3.0
UNO = 0.0
DOS = 240.0
TRES = 480.0
SEIS = 720.0
DIEZ = 960.0
WRITE(3,8)
1 UNO = UNO + 1.0
DOS = DOS + 1.0
TRES = TRES + 1.0
SEIS = SEIS + 1.0
DIEZ = DIEZ + 1.0
ONU = UNO ** SUB
SOD = DOS ** SUB
SERT = TRES ** SUB
SIES = SEIS ** SUB
ZEID = DIEZ ** SUB
WRITE(3,9)UNO,ONU,DOS,SOD,TRES,SERT,SEIS,SIES,DIEZ,ZEID
IF(UNO -240.0)2,3,3
2 GO TO 1
8 FORMAT(1H1,49X,'TABLA DE RAICES CUBICAS',///)
9 FORMAT(F12.0,F12.7,F12.0,F12.7,F12.0,F12.7,
1F12.0,F12.7,F12.0,F12.7)
3 CALL EXIT
END
// XEQ
A brief explanation of some cards follows:
| // JOB T | Is the $3 pesos orange "JOB" card; the "T" indicate "Temporary" job: any code compiled in this job will be erased when the job ends. | |
| // FOR | Run the FORTRAN compiler. | |
| *IOCS ... | Input Output Control System: the CARD reader and the 1132 first CECAFI's slow PRINTER. The CECAFI later received a very fast 1403 PRINTER. | |
| *ONE ... | To use ONE WORD INTEGERS instead of the Two-Words default (that just wasted the second word). | |
| *EXTENDED ... | To increase the precision of floating point variables, the ones that start with a letter not in the I-N range (that was reserved for integer variables). | |
| *LIST ... | So the listing of the compiled source program be printed. | |
| After I entered CECAFI I modified the default values of the FORTRAN compiler, so all previous * cards (and the *SAVE card, needed to compile subroutines) were not longer necessary. | ||
| ** LILIA ... | Identification card: | |
| LILIA | My then girlfriend's name (and later my wife for a little less than 40 years...) | |
| 0480 | The code of Numerical Methods, the class that most use FORTRAN programs. | |
| 7593905-4 | My account number as UNAM's student. | |
| PEREZ ... | My name. | |
| 75/05/7 | The date in YY/MM/DD format. | |
| // XEQ | "eXEQute" the just compiled program. | |
Note the arithmetic IF(UNO -240.0)2,3,3 statement. Although CECAFI's FORTRAN compiler already supported the logical IF of FORTRAN-IV, like IF(UNO .LT. 240.0)GOTO 2, I learned FORTRAN in the FORTRAN-II MacCracken book, that did not included such logical IF.
In the "8 FORMAT" specification, the 1H1 part is a "Hollerith" field that just show text in the same way as '1' does, but that required a character count (5HHELLO = 'HELLO'). The first column in the printer was reserved as "Carriage control column"; the characters output in this column controls the vertical movement of the paper: a '1' ejects the paper to new page and I think that a '2' skip to next vertical tabulation line.
I used "UNO", "DOS" and "TRES" ("one", "two" and "three") variable names, but I didn't used "CUATRO" ("four") because it have more than 5 letters, that was the maximum number of characters that the FORTRAN-II book marked for a variable name. As an anecdote, this is the same reason that caused that "FORTH" programming language have such a name: its developer originally wanted to name it "Fourth", but the language was developed on an IBM-1130 computer that just allowed 5 characters for program names.